<template>
  <el-button type="success" @click="test">推送故事</el-button>
  <div style="padding-top: 30px">
    <TEditor v-model:value="htmlString" ref="editorRef"></TEditor>
  </div>
</template>

<script lang="ts" setup>
import TEditor from '@/base-ui/editor'
import { ref } from 'vue'
import type Editor from 'wangeditor'
import { useStore } from '@/store'

const store = useStore()
const htmlString = ref<string>('eason')
const editorRef = ref<InstanceType<typeof Editor>>()
const test = () => {
  const story = {
    queryInfo: {
      content: editorRef.value?.content.text,
      title: 'Eason'
    },
    pageName: 'story'
  }
  store.dispatch('story/setStoryList', story)
}
</script>
<style lang="less" scoped>
el-button {
  margin-left: 10px;
}
</style>
